package com.w2cx.selenium.testCase;

import com.w2cx.selenium.base.DriverBase;
import org.testng.Assert;
import org.apache.log4j.Logger;
import org.testng.annotations.Parameters;
import org.testng.annotations.Test;

public class testInformationManage extends CaseBase{
    //LoginProcess loginPro;
    //InformationManageProcess informationManagePro;
   // CookieHandle cookieHandle;
    DriverBase driver;
    static Logger logger = Logger.getLogger(testInformationManage.class);

    @Test
    @Parameters({"searchCategoryName"})
    public void testSearchInformationCategory(String searchCategoryName){
        //测试搜索资讯分类
        informationManagePro.informationCategorySearch(searchCategoryName);

        //断言是否搜索成功
        Assert.assertTrue(informationManagePro.searchCategorySuccess(),"搜索资讯分类失败！");
        logger.info("搜索资讯分类成功！");

    }

    @Test    //(dependsOnMethods = "testInformationCategorySearch")
    @Parameters({"addCategoryName"})
    public void testAddInformationCategory(String addCategoryName){

        //测试添加资讯分类
        informationManagePro.informationCategoryAdd(addCategoryName);

        //判断是否增加成功
        Assert.assertTrue( informationManagePro.addCategorySuccess(addCategoryName),"添加资讯分类失败");
        System.out.println("添加资讯分类成功！");
    }


    @Test    //(dependsOnMethods = "testInformationCategoryAdd")
    @Parameters({"addCategoryName"})
    public void testDelInformationCategory(String addCategoryName){
        //删除新增的分类
        informationManagePro.informationCategoryDel(addCategoryName);

        //断言
        Assert.assertTrue(informationManagePro.delSuccess(addCategoryName),"删除资讯分类失败");
        System.out.println("删除资讯分类成功！");


    }












}
